<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 
    把容器的剩余空间  按照特定比例  进行分配
    flex-grow ： 0 (默认)
                当grow总和>=1按照相应的比例
                当grow总和小于1时，增长的宽度=容器剩余空间 * 0.n
                 
  -->
  <style>
    *{
      box-sizing: border-box;
    }
    .container{
      width: 300px;
      height: 100px;
      border: 1px solid;
      display: flex;
    }
    .container div{
      border: 1px solid;
      background-color: #ccc;
    }
    .container :nth-child(1){
      width: 100px;
    }
    .container :nth-child(2){
      flex-grow: 2;
    }
    .container :nth-child(3){
      flex-grow: 1;
    }

  </style>
  <div class="container">
    <div>1</div>
    <div>2</div>
    <div>3</div>
  </div>



  <!-- 当grow总和小于1时，增长的宽度 = 容器剩余空间 * 0.n -->
  <style>
    .grow{
      width: 300px;
      height: 100px;
      border: 1px solid;
      display: flex;
    }
    .grow div{
      border: 1px solid;
      background-color: #ccc;
    }
    .grow :nth-child(1){
      width: 100px;
    }
    .grow :nth-child(2){
      /* 178 * 0.2 = 35.6 */
      /* width = 原 width + 35.6  */
      flex-grow: 0.2;
    }
    .grow :nth-child(3){
      flex-grow: 0.7;
    }
  </style>
  <div class="grow">
    <div>1</div>
    <div>2</div>
    <div>3</div>
  </div>
</body>
</html>